﻿Public Class TheXacNhan

    Private Sub TheXacNhan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim bang1 As DataTable = NguoiThueNha_BUS.LoadTenNguoiThue()
        cmbTenNguoiThue.DataSource = bang1
        cmbTenNguoiThue.DisplayMember = "TenNguoiThue"
        cmbTenNguoiThue.ValueMember = "MaNguoiThue"
        Dim bang As DataTable = NhaChoThue_BUS.loadmaNha()
        cmbMaNha.DataSource = bang
        cmbMaNha.DisplayMember = "MaNha"
        Dim bang2 As DataTable = NhanVien_BUS.loadTenNhanVien()
        cmbTenQL.DataSource = bang2
        cmbTenQL.DisplayMember = "TenQL"
        cmbTenQL.ValueMember = "MaQL"
    End Sub

    Private Sub BtnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnThem.Click
        Dim Kt As New KiemTraNha_DTO()
        Kt.MaNha = cmbMaNha.SelectedIndex + 1
        Kt.MaQL = cmbTenQL.SelectedValue
        Kt.NgayKiemTra = MaskedTextBox1_NgayLapThe.Text
        Kt.Trangthai = txtXacNhan.Text
        Kt.MaNguoiThue = cmbTenNguoiThue.SelectedValue
        KiemTraNha_BUS.ThemDuLieuNguoiThue(Kt)
    End Sub

    Private Sub BtnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnThoat.Click
        Me.Close()
    End Sub
End Class